import request from '@/utils/request'

// 查询区域列表
export function listSysArea(query) {
  return request({
    url: '/area/sysArea/list',
    method: 'get',
    params: query
  })
}

// 查询区域详细
export function getSysArea(id) {
  return request({
    url: '/area/sysArea/' + id,
    method: 'get'
  })
}

// 保存区域
export function saveSysArea(data) {
  return request({
    url: '/area/sysArea/save',
    method: 'post',
    data: data
  })
}

// 删除区域
export function delSysArea(id) {
  return request({
    url: '/area/sysArea/' + id,
    method: 'delete'
  })
}

// 导出区域
export function exportSysArea(query) {
  return request({
    url: '/area/sysArea/export',
    method: 'get',
    params: query
  })
}

export function treeSelect(query) {
  return request({
    url: '/area/sysArea/treeSelect',
    method: 'get',
    params: query
  })
}

export function selectCascaderChina(query) {
  return request({
    url: '/area/sysArea/selectCascaderChina',
    method: 'get',
    params: query
  })
}

export function selectCascaderLazy(parentId) {
  return request({
    url: '/area/sysArea/selectCascaderLazy/' + parentId,
    method: 'get'
  })
}

export function selectCascaderLazyEcho(lastId) {
  return request({
    url: '/area/sysArea/selectCascaderLazyEcho/' + lastId,
    method: 'get'
  })
}

// 根据省级ID，获取所有的市级区域
export function cityListByProvinceId(parentId) {
  return request({
    url: '/area/sysArea/getCityList/' + parentId,
    method: 'get'
  })
}

// 查询所有的省级区域
export function allProvinceList() {
  return request({
    url: '/area/sysArea/allProvinceList',
    method: 'get'
  })
}

// 查询所有的国家区域
export function getCountryList() {
  return request({
    url: '/area/sysArea/getCountryList',
    method: 'get'
  })
}

